package com.example.glgk.controller.analysis;


import com.example.glgk.dto.indicator.*;
import com.example.glgk.service.indicator.IndicatorCalculateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;


/**
 * @author liuxingkun
 * <p>version2.0版本</p>
 */
@Api(tags = "指标计算接口")
@Slf4j
@RestController
@RequestMapping("/IndicatorCalculateController")
@CrossOrigin(origins = "*")
public class IndicatorCalculateController {


    @Autowired
    IndicatorCalculateService indicatorCalculateService;

    @ApiOperation(value = "系统自动生成接口")
    @PostMapping("/systemGenerate")
    public List<CommonDto> systemGenerate() {
        return indicatorCalculateService.systemGenerate();
    }

    @ApiOperation(value = "附件1数据")
    @PostMapping("/annexData")
    public List<AnnexDataDto> annexData(@RequestBody IndicatorCalculateDto indicatorCalculateDto) {
        return indicatorCalculateService.annexData(indicatorCalculateDto);
    }

    @ApiOperation(value = "附件1数据-新")
    @PostMapping("/annexIndicatorData")
    public List<AnnexDataDto> annexIndicatorData(@RequestBody IndicatorCalculateDto indicatorCalculateDto) {
        return indicatorCalculateService.annexIndicatorData(indicatorCalculateDto);
    }

    @ApiOperation(value = "退步/进步/满分 总览数据接口")
    @PostMapping("/getOverviewData")
    public Map<String, List<IndicatorOverviewDto>> getOverviewData(@RequestBody IndicatorCalculateDto indicatorCalculateDto) {
        return indicatorCalculateService.getOverviewData(indicatorCalculateDto);
    }


    @ApiOperation(value = "监测指标 总览数据接口")
    @PostMapping("/getMonitorIndicatorOverviewData")
    public Map<String, List<IndicatorOverviewDto>> getMonitorIndicatorOverviewData(@RequestBody IndicatorCalculateDto indicatorCalculateDto) {
        return indicatorCalculateService.getMonitorIndicatorOverviewData(indicatorCalculateDto);
    }

    @ApiOperation(value = "监测指标 数据明细接口")
    @PostMapping("/getMonitorIndicatorDataList")
    public List<DataListDto> getMonitorIndicatorDataList(@RequestBody IndicatorCalculateDto indicatorCalculateDto) {
        return indicatorCalculateService.getMonitorIndicatorDataList(indicatorCalculateDto);
    }

    @ApiOperation(value = "非监测指标 总览数据接口")
    @PostMapping("/getCommonIndicatorOverviewData")
    public Map<String, List<IndicatorOverviewDto>> getCommonIndicatorOverviewData(@RequestBody IndicatorCalculateDto indicatorCalculateDto) {
        return indicatorCalculateService.getCommonIndicatorOverviewData(indicatorCalculateDto);
    }

    @ApiOperation(value = "非监测指标 数据明细接口")
    @PostMapping("/getCommonIndicatorDataList")
    public List<DataListDto> getCommonIndicatorDataList(@RequestBody IndicatorCalculateDto indicatorCalculateDto) {
        return indicatorCalculateService.getCommonIndicatorDataList(indicatorCalculateDto);
    }


    @ApiOperation(value = "退步/进步/满分 部门/绩效专班 明细数据接口")
    @PostMapping("/getDataList")
    public List<DataListDto> getDataList(@RequestBody IndicatorCalculateDto indicatorCalculateDto) {
        return indicatorCalculateService.getDataList(indicatorCalculateDto);
    }

    @ApiOperation(value = "附件2,3的数据")
    @PostMapping("/otherAnnexData")
    public List<AnnexDataDto> otherAnnexData(@RequestBody IndicatorCalculateDto indicatorCalculateDto) {
        return indicatorCalculateService.otherAnnexData(indicatorCalculateDto);
    }

    @ApiOperation(value = "附件2数据-新")
    @PostMapping("/otherAnnexMonitorData")
    public List<AnnexDataDto> otherAnnexMonitorData(@RequestBody IndicatorCalculateDto indicatorCalculateDto) {
        return indicatorCalculateService.otherAnnexMonitorData(indicatorCalculateDto);
    }

    @ApiOperation(value = "附件3数据-新")
    @PostMapping("/otherAnnexCommonData")
    public List<AnnexDataDto> otherAnnexCommonData(@RequestBody IndicatorCalculateDto indicatorCalculateDto) {
        return indicatorCalculateService.otherAnnexCommonData(indicatorCalculateDto);
    }



}
